//
// Copyright (C) 2004-2006  Autodesk, Inc.
// 
// This library is free software; you can redistribute it and/or
// modify it under the terms of version 2.1 of the GNU Lesser
// General Public License as published by the Free Software Foundation.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#ifndef FDOOWSBOUNDINGBOX_H
#define FDOOWSBOUNDINGBOX_H

#ifdef _WIN32
#pragma once
#endif // _WIN32

#include "stdafx.h"

class FdoOwsBoundingBox : public FdoXmlSaxHandler, public FdoIDisposable
{
	typedef FdoXmlSaxHandler BaseType;

public:
    FDOWCS_API static FdoOwsBoundingBox* Create(void);

public:
    FDOWCS_API FdoDoubleArray* GetLowerCorner() const;
    FDOWCS_API void SetLowerCorner(FdoDoubleArray* value);

    FDOWCS_API FdoDoubleArray* GetUpperCorner() const;
    FDOWCS_API void SetUpperCorner(FdoDoubleArray* value);

    FDOWCS_API virtual FdoString* GetCRS() const;
    FDOWCS_API virtual void SetCRS(FdoString* value);

    FDOWCS_API virtual FdoSize GetDimensions() const;
    FDOWCS_API virtual void SetDimensions(FdoSize value);

    void InitFromXml(FdoXmlSaxContext* context, FdoXmlAttributeCollection* attrs);

    virtual FdoXmlSaxHandler* XmlStartElement(
        FdoXmlSaxContext* context, 
        FdoString* uri, 
        FdoString* name, 
        FdoString* qname, 
        FdoXmlAttributeCollection* atts
    );

    FdoBoolean XmlEndElement(FdoXmlSaxContext* context, FdoString* uri, FdoString* name, FdoString* qname);

    FDOWCS_API FdoDouble GetMinX() const;
    FDOWCS_API void SetMinX(FdoDouble value);

    FDOWCS_API FdoDouble GetMinY() const;
    FDOWCS_API void SetMinY(FdoDouble value);

    FDOWCS_API FdoDouble GetMaxX() const;
    FDOWCS_API void SetMaxX(FdoDouble value);

    FDOWCS_API FdoDouble GetMaxY() const;
    FDOWCS_API void SetMaxY(FdoDouble value);

protected:
    FdoOwsBoundingBox(void);
    virtual ~FdoOwsBoundingBox(void);
    void Dispose();

protected:
    FdoDoubleArray*                  mLowerCorner;
    FdoDoubleArray*                  mUpperCorner;
    FdoStringP                       mCRS;
    FdoSize                          mDimensions;
    FdoXmlCharDataHandlerP           mXmlContentHandler;

private:
    FdoDouble mMinX;
    FdoDouble mMinY;
    FdoDouble mMaxX;
    FdoDouble mMaxY;

};

typedef FdoPtr<FdoOwsBoundingBox> FdoOwsBoundingBoxP;

#endif // FDOOWSBOUNDINGBOX_H


